﻿using System;
using ExtraClub.Domain;
using ExtraClub.Domain.Entities;
using SubSonic;
using System.Collections.Generic;
using ExtraClub.Domain.Framework;

namespace ExtraClub.Web.Controls.mail_queue {
    public partial class module : BaseModule {

        protected Club CurrentClub = null;
        protected List<MailQueue> mails = null;
        protected int SelectedId = 0;

        protected override void OnLoad(EventArgs e) {
            base.OnLoad(e);

            Query q = ClubInUser.CreateQuery();
            q.AddWhere(ClubInUser.Columns.UserId, SiteContext.Current.User.ProviderUserKey);
            ClubInUserCollection club_in_user = new ClubInUserController().FetchByQuery(q);

            if (club_in_user.Count > 0) {
                CurrentClub = club_in_user[0].Club;
                if (!IsPostBack) {
                } else {
                    if (Request.Form["select"] != null) {
                    }
                }
            }
            if (CurrentClub != null) {
                mails = CurrentClub.MailQueueRecords.GetList();
            }
        }
    }
}
